package string;

public class ConsecutiveCharacters1446 {
    public int maxPower(String s) {
        int max = 0;
        if(s.length()==0){
            return max;
        }
        char pre = s.charAt(0);
        int cur_count=1;
        max = 1;
        for (int i = 1; i < s.length(); i++) {
            if(s.charAt(i) == pre){
                cur_count++;
            }else {
                pre = s.charAt(i);
                cur_count=1;
            }
            max = Math.max(max,cur_count);
        }
        return max;
    }
}
